package com.zz.forum.controller;

import com.zz.forum.common.AppResult;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.zz.forum.exception.ApplicationException;

@RestController
@RequestMapping("/test")
public class TestController {
    @GetMapping("/exception")
    public AppResult exception () throws Exception {
        throw new Exception("这是一个exception");
    }

    @GetMapping("/Application")
    public AppResult testApplicationException()  {
        throw new ApplicationException("这是一个ApplicationException");
    }
}
